<template>
  <div class="header">
    <div class="left">
      <img class="logo" src="../assets/logo.jpg" alt="logo">
      <router-link to="/main" style="text-decoration: none;color: black"><span style="padding-left: 15px">徐同学书店</span></router-link>
    </div>

      <div style="float: right">
        <span style="margin-right: 10px">尊敬的管理员,你好!</span>
        <el-button type="primary" @click="logout">退出</el-button>
      </div>
  </div>
</template>

<script>
  import router from "../router";

  export default {
    name: "AHeader",
    data() {
      return {}
    },
    methods: {
      logout() {
        router.push("/admin/login")
      },
    }
  }
</script>

<style scoped>
  .header {
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
  }
  .left {
    display: flex;
    align-items: center;
  }
  .logo {
    width: 40px;
    height: 40px;
    display: inline-block;
    box-sizing: border-box;
  }
</style>